#ifndef SERIALPORTTHREAD_H
#define SERIALPORTTHREAD_H

#include "serialportdefine.h"
#include "serialportglobal.h"
#include <QThread>
#include <QMetaType>

class SerialportThread : public QThread
{
    Q_OBJECT
public:
    explicit SerialportThread(QObject *parent = 0);
    ~SerialportThread();

    // 停止线程
    void setThreadStop(bool state){ m_stop = state; }

protected:
    void run();

signals:
    // 线程运行后执行
    void newDataRcved(QByteArray data);

private:
    bool m_stop;

};

#endif // SERIALPORTTHREAD_H
